using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ViewOn.AddIns;
using ViewOnCore;
using ViewOnCore.HostContract;
using ViewOnCore.Visual;

namespace ViewOn.UI.VisualModeContainer
{
    /// <summary>
    /// 
    /// </summary>
    public partial class MiniViewModeContainer : System.Windows.Controls.UserControl, IVisualModeContainer
    {

        #region Constructor

        public MiniViewModeContainer()
        {
            InitializeComponent();
        }

        #endregion

        #region Implements : IViewModeContainer

        public void ChangeVisualPart(VisualPart visualPart)
        {
            //---- Deactivate the other add ins
            Host.VisualService.UnactiveVisualPart();
            visualPart.IsActive = true;

            //---- Display
            visualPart.OnPreDisplay(this);

            gridContainer.Children.Clear();
            gridContainer.Children.Add((UIElement)visualPart);

            visualPart.OnPostDisplay(this);
        }

        #endregion

    }
}